public class OrderContext {

    AbstractOrderState waitPaid;
    AbstractOrderState waitDeliver;
    AbstractOrderState receiveGoods;

    AbstractOrderState currState;


    public OrderContext() {
        this.waitPaid = new WaitPaidOrderState(this);
        this.waitDeliver = new WaitDelieverOrderState(this);
        this.receiveGoods = new ReceiveGoodsOrderState(this);
        currState = waitPaid;

    }

    void setState(AbstractOrderState state) {
        this.currState = state;
    }

    public void payOrder() {
        currState.payOrder();
    }

    public void deliver() {
        currState.deliver();
    }

    public void receiveGoods() {
        currState.receiveGoods();
    }
}